package com.paradigmcreatives.game.listeners;

import com.paradigmcreatives.game.DoodleGameActivity;

import com.paradigmcreatives.game.R;
import android.R.color;
import android.graphics.Color;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

public class ColorOnClickListener implements OnClickListener {

	private static final String TAG = "ColorOnClickListener";
	DoodleGameActivity doodleGameActivity;
	
	public ColorOnClickListener(DoodleGameActivity doodleGameActivity) {
		this.doodleGameActivity= doodleGameActivity;
	}
	
	@Override
	public void onClick(View v) {  
		int color = Color.parseColor(v.getTag().toString());
		Log.i(TAG, "colorcode is " + color);
		doodleGameActivity.doodleCanvas.setPaintColor(color);
		v.startAnimation(AnimationUtils.loadAnimation(doodleGameActivity, R.anim.wave_scale));
	}

}
